﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mobile;

namespace Infrastructure.WebMobile
{
    public class MobileDeviceFilter 
    {
        public static bool UseSmallGif(MobileCapabilities caps, String notused)
        {
            bool retval = false;
            if (caps.PreferredImageMime == "image/gif" &&
                (caps.ScreenPixelsWidth < 100))
                retval = true;
            return retval;
        }
        public static bool UseLargeGif(MobileCapabilities caps, String notused)
        {
            bool retval = false;
            if (caps.PreferredImageMime == "image/gif" && !(caps.ScreenPixelsWidth < 100))
                retval = true;
            return retval;
        }
        public static bool UseSmallWBMP(MobileCapabilities caps, String notused)
        {
            bool retval = false;
            if (caps.PreferredImageMime == "image/vnd.wap.wbmp" &&
                (caps.ScreenPixelsWidth < 100))
                retval = true;
            return retval;
        }
        public static bool UseLargeWBMP(MobileCapabilities caps, String notused)
        {
            bool retval = false;
            if (caps.PreferredImageMime == "image/vnd.wap.wbmp" &&
                !(caps.ScreenPixelsWidth < 100))
                retval = true;
            return retval;
        }
    }
}
